
import request from "@/utils/request";
import { strToObj } from "@/utils/common";
const BEAS_URL = '/api/admin/lottery-predictions'
class predictApi {
  /*     获取列表     */
  static getList (params) {
    return request({
      url: `${BEAS_URL}`,
      method: "GET",
      params: params
    });
  }
  /*     获取    */
  static get (id) {
    return request({
      url: `${BEAS_URL}/${id}`,
      method: "GET",
    });
  }
  /*     添加     */
  static add (datas) {
    // const datas = JSON.parse(JSON.stringify(data))
    // datas.meta = strToObj(datas.meta)
    return request({
      url: `${BEAS_URL}`,
      method: "POST",
      data: datas
    });
  }
  /*     修改    */
  static put (data) {
    // const datas = JSON.parse(JSON.stringify(data))
    // datas.meta = strToObj(datas.meta)
    return request({
      url: `${BEAS_URL}/${data.id}`,
      method: "PUT",
      data: data
    });
  }
  /*     删除     */
  static del (data) {
    return request({
      url: `${BEAS_URL}/${data.id}`,
      method: "DELETE",
    });
  }
}
export default predictApi;